import { Notification } from 'element-ui'
import router from './router'
router.beforeEach((to, from, next) => {
  if(to.path === '/login') {
    next()
  }else if(window.sessionStorage.getItem('token')) {
    next()
  }else {
    Notification.warning({
      title: '错误',
      message: '登录过期，请重新登录！',
      duration: 3000
    })
    next('/login')
  }
})
